# include <iostream>
# include <algorithm>
# include <stdio.h>
# include <stack>
# include <string.h>

using namespace std;

char s[110], str1[110], str2[110];
int main(void)
{
    int t = 0, i, o = 0;
    while(~scanf("%s", s))
    {
        if(!strcmp(s, "@@@@@@"))
            break;
        if(s[0] == '/' && s[1] == '/')
            continue;
        int k = strlen(s);
        for(i = 0; i < k; i++)
            if(s[i] != ' ')
                str1[t++] = s[i];
    }
    while(~scanf("%s", s))
    {
        if(s[0] == '/' && s[1] == '/')
            continue;
        int k = strlen(s);
        for(i = 0; i < k; i++)
            if(s[i] != ' ')
                str2[o++] = s[i];
    }
    //printf("%s\n%s\n", str1, str2);
    if(strcmp(str1, str2) == 0)
    printf("Yes\n");
    else
    printf("No\n");

    return 0;
}
 



/**************************************
    Problem id	: SDUT OJ 1571 
	User name	: Good Luck 
	Result		: Accepted 
	Take Memory	: 452K 
	Take Time	: 0MS 
	Submit Time	: 2013-07-30 21:18:14  
**************************************/
